﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class TV
    {
        private int currentChanel = 0;
        private List<Chanel> chanelList = new List<Chanel>();


        private void AddChanelToList()
        {
            Chanel newChanel1 = new Chanel(112, "112 news");
            chanelList.Add(newChanel1);
            Chanel newChanel2 = new Chanel(5, "5 chanel");
            chanelList.Add(newChanel2);
            Chanel newChanel3 = new Chanel(2, "1+1");
            chanelList.Add(newChanel3);
            Chanel newChanel4 = new Chanel(1, "UBR");
            chanelList.Add(newChanel4);
            Chanel newChanel5 = new Chanel(2, "STB");
            chanelList.Add(newChanel5);
        }

        public TV()
        {
            AddChanelToList();
        }

        public void CurrentChanel()
        {
            Console.WriteLine("Current chanel is: {0}", chanelList[currentChanel].ChanelName);
        }

        public void ChanelUp()
        {
            if (currentChanel >= chanelList.Count - 1)
            {
                currentChanel = 0;
            }
            else currentChanel++;
        }

        public void ChanelDown()
        {
            if (currentChanel <= 0)
            {
                currentChanel = chanelList.Count-1;
            }
            else currentChanel--;

        }
    }
}
    


    

    

